﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Mappings;

namespace Apollo
{
    [NHibernateEntity(Table = "Products", Lazy = true)]
    public class Product : ITrackable, ILegacy, IStateable
    {
        public Product() { }

        [PrimaryKey]
        public virtual int Id { get; set; }

        [Property]
        public virtual string Name { get; set; }

        [Property]
        public virtual string Code { get; set; }

        [BelongsTo(Column = "ID_ProductCategory")]
        public virtual ProductCategory ProductCategory { get; set; }

        [BelongsTo(Column = "ID_Parent_Product")]
        public virtual Product Parent { get; set; }

        [Property]
        public virtual ProductType ProductType { get; set; }

        [Property]
        public virtual State State { get; set; }

        [Property]
        public virtual string LegacyApplication { get; set; }

        [Property]
        public virtual string LegacyID { get; set; }

        [Property]
        public virtual DateTime StartDate { get; set; }

        [Property]
        public virtual DateTime? EndDate { get; set; }


        [Property]
        public virtual DateTime InsertDate { get; set; }

        [Property]
        public virtual string InsertBy { get; set; }

        [Property]
        public virtual DateTime? ModifiedDate { get; set; }

        [Property]
        public virtual string ModifiedBy { get; set; }

        [Property]
        public virtual double MonthlyLoading { get; set; }

        [Property]
        public virtual double QuaterlyLoading { get; set; }

        [Property]
        public virtual double HalfYearLoading { get; set; }

        [Property]
        public virtual double YearlyLoading { get; set; }

        [Property]
        public virtual DateTime? FirstCommissionDate { get; set; }

    }

    public enum ProductType { 
        Main = 0,
        Rider = 1
    }

    public enum ProductState {
        Inactive = 0,
        Active = 1,

    }
}
